package com.ruoyi.system.sale.domain;

import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 预警信息对象 sale
 *
 * @author ruoyi
 * @date 2024-06-16
 */
@Data
public class Sale implements Serializable
{
    private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mmXXX");
    private static final long serialVersionUID = 1L;

    /** 主键 */
    private String id;

    /** 城市id */
    @Excel(name = "城市id")
    private String cityId;

    /** 城市名称 */
    @Excel(name = "城市名称")
    private String cityName;

    /** 预警发布单位 */
    @Excel(name = "预警发布单位")
    private String sender;

    /** 预警信息标题 */
    @Excel(name = "预警信息标题")
    private String title;

    /** 预警信息的发布状态 */
    @Excel(name = "预警信息的发布状态")
    private String status;

    /** 预警严重等级 */
    @Excel(name = "预警严重等级")
    private String severity;

    /** 预警详细文字描述 */
    @Excel(name = "预警详细文字描述")
    private String text;

    /** 预警发布时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "预警发布时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date pubTime;

    /** 预警开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "预警开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startTime;

    /** 预警结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "预警结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endTime;

    /** 预警严重等级颜色 */
    @Excel(name = "预警严重等级颜色")
    private String severityColor;

    /** 预警类型ID */
    @Excel(name = "预警类型ID")
    private String type;

    /** 预警类型名称 */
    @Excel(name = "预警类型名称")
    private String typeName;

    /** 预警信息的紧迫程度 */
    @Excel(name = "预警信息的紧迫程度")
    private String urgency;

    /** 预警信息的确定性 */
    @Excel(name = "预警信息的确定性")
    private String certainty;

    /** 与本条预警相关联的预警ID */
    @Excel(name = "与本条预警相关联的预警ID")
    private String related;

    /** 创建时间 */
    @JsonIgnore
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdAt;

    /** 创建人 */
    @JsonIgnore
    @Excel(name = "创建人")
    private String createdBy;

    /** 更新时间 */
    @JsonIgnore
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date updatedAt;

    /** 更新人 */
    @JsonIgnore
    @Excel(name = "更新人")
    private String updatedBy;

    /** 是否删除(1删除) */
    @JsonIgnore
    @Excel(name = "是否删除(1删除)")
    private String deleteFlag;

    private String level;


    public Date getPubTime() {
        return pubTime;
    }

    public void setPubTime(String pubTime) {
        try {
            this.pubTime = simpleDateFormat.parse(pubTime);
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        try {
            this.startTime = simpleDateFormat.parse(startTime);
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        try {
            this.endTime = simpleDateFormat.parse(endTime);
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }
}
